<?php
class Model_JsCfgData
{
	var $_DiscriptArr;

	function OutJs() {
		$Out = '';
		$_Id2Discription= array('TerminalLevel','GoodsStatus','MemberStatus','MemberLevel','EmployeeStatus','Roles','PreferentialStyle');
		
			// Id2Discription参数数组
			$this->_DiscriptArr['Id2Discription'] = array();
			foreach($_Id2Discription as $discr) {
				$t = & FLEA::getSingleton('Table_'.$discr);
				if (FLEA::isRegistered('Table_'.$discr)){
					$this->_DiscriptArr['Id2Discription'][$discr] = $t->findAll();
				}else{
					$this->_DiscriptArr['Id2Discription'][$discr] = 'Table_'.$discr.' not finder';
				}
			}
			
			//其它参数数组
			//...

		$Out = '';
		$Out.= '<script type="text/javascript">';
		$Out.= 'var jsCfgData=Array();';
		$Out.= 'jsCfgData=Ext.decode(\''.json_encode($this->_DiscriptArr).'\');';
		$Out.= '</script>';
		return $Out;
	}
	function Add($name,$arr) {
		if(is_array($arr)) {
			$this->_DiscriptArr[$name] = $arr;
		}
	}
}
?>